import os, sys

parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 4)))
sys.path.insert(0, parent_path)

import traceback
import numpy as np
import socket, json, cv2
from typing import *
from core.task.modules.processors.base_processor import BaseProcessor

class RTMPProcessor(BaseProcessor):
    """将数据通过http回传到接口
    """
    def __init__(self, keys) -> None:
        self.keys = keys
    def __call__(self, data:Dict) -> Dict:
        
        
        det_result = data[self.keys["car"]]
        for bboxes, box_num in zip(det_result["boxes"],det_result["boxes_num"]):
            for bbox in bboxes:
                x1,y1,x2,y2 = bboxes
        print("")

        # cv2.imwrite("temp.jpg",data["input_data"][0])
            
            
        return data

    def close(self):
        self.status = 0
